feat(codex): ship native basecamp plugin#534
Conversation
Sensitive Change Detection (shadow mode)This PR modifies control-plane files:
|
There was a problem hiding this comment.
Pull request overview
This PR adds first-class support for a native Codex plugin alongside the existing Claude Code integration, including plugin payload validation, lifecycle hooks, setup automation, and doctor diagnostics so Codex users can get a one-command setup path.
Changes:
- Introduces a native Codex plugin manifest, hook payload, and a repository validator (
scripts/check-codex-plugin.py) enforced bybin/ci. - Adds
basecamp setup codexplus Codex-related doctor checks (plugin installed/enabled + version parity) and release stamping for.codex-plugin/plugin.json. - Documents Codex setup (automatic + manual) while keeping the Claude Code path intact.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| skills/basecamp-doctor/SKILL.md | Adds a dedicated “doctor” skill describing how to run and interpret basecamp doctor --json safely. |
| scripts/stamp-codex-plugin-version.sh | Adds a release helper to stamp the CLI version into the Codex plugin manifest. |
| scripts/release.sh | Stamps + stages the Codex plugin manifest during stable releases and updates messaging. |
| scripts/check-codex-plugin.py | Adds a repository contract/shape validator for the Codex plugin payload (manifest, hooks, wiring, version parity). |
| RELEASING.md | Documents that stable releases update both Claude and Codex plugin metadata. |
| README.md | Documents basecamp setup codex, manual install commands, and basecamp doctor --json coverage. |
| internal/release/codex_plugin_test.go | Adds tests for stamping, repository validation, and release wiring/version parity. |
| internal/harness/codex.go | Adds Codex detection and doctor checks (plugin presence + version parity) to the agent harness. |
| internal/harness/codex_test.go | Adds unit tests covering Codex detection and the new doctor checks. |
| internal/commands/wizard_codex.go | Implements basecamp setup codex to register marketplace, install plugin, and verify state. |
| internal/commands/wizard_codex_test.go | Tests Codex setup command behavior (ordering, idempotency, failures, JSON output). |
| internal/commands/doctor.go | Adds doctor breadcrumbs for Codex plugin failures/warnings to point users at basecamp setup codex. |
| internal/commands/doctor_test.go | Tests Codex doctor integration wiring and breadcrumb behavior. |
| internal/commands/codex_hook.go | Adds hidden basecamp codex-hook … commands used by Codex lifecycle hooks. |
| internal/commands/codex_hook_test.go | Tests session-start context output and post-commit reference detection behavior. |
| internal/cli/root.go | Registers the hidden Codex hook command group in the CLI root. |
| install.md | Adds Codex setup docs (one-command + manual) and recommends basecamp doctor --json verification. |
| hooks/hooks.json | Adds Codex-native lifecycle hook definitions for SessionStart and PostToolUse(Bash). |
| bin/ci | Enforces Codex plugin payload validation via scripts/check-codex-plugin.py. |
| AGENTS.md | Updates repository structure docs to include .codex-plugin/ and hooks/. |
| .goreleaser.yaml | Stamps both Claude + Codex plugin versions for stable releases via GoReleaser hooks. |
| .codex-plugin/plugin.json | Adds the native Codex plugin manifest (name/version/interface/skills/assets). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
All reported issues were addressed across 22 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
coordinated codex marketplace follow-upThe companion marketplace payload is ready at GitHub currently denies contributor-created pull requests to |
There was a problem hiding this comment.
All reported issues were addressed across 11 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 4 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
The post-commit hook could never fire on Codex: it gated on structured exit_code/success/status fields in tool_response, but Codex sends Bash tool_response as a plain JSON string of shell output. Remove the hook command, its bash-AST parsing (and the mvdan.cc/sh dependency), and hooks/hooks.json rather than ship dormant code; hooks return in a follow-up PR built on a design proven against both agents' payloads. Replace scripts/check-codex-plugin.py and its meta-tests with pure Go manifest tests: parse both plugin manifests, enforce strict semver and version parity, verify referenced paths exist, and check hooks.json hook commands (tolerant of absence) — all under make test, with no python dependency and no __pycache__ pollution. bin/ci is make check again. Claude-Session: https://claude.ai/code/session_01QzoKavmhTPzErRna2KkTKS
Add AgentInfo.Diagnostics — the full doctor check suite, run with the caller's context — alongside Checks, which stays cheap and version-free to gate setup wizard behavior. Codex registers its single-query plugin+version diagnostics; Claude registers its plugin, skill-link, and relocated plugin-version checks. Doctor now iterates agents generically (Diagnostics when present, Checks otherwise) instead of special-casing agent IDs. Also replace error-string sniffing in codexQueryFailure with a typed parse sentinel. Claude-Session: https://claude.ai/code/session_01QzoKavmhTPzErRna2KkTKS
Setup now prints per-step progress lines, streams codex stderr to the terminal while capturing stdout for --json parsing, and bounds each subprocess with its own timeout (20s marketplace/install, 5s verify) instead of one 30s umbrella. Failures return a typed agentSetupError carrying a summary plus manual remediation commands. Non-interactive setup surfaces them as errors[], a new manual_commands field, and per-command breadcrumbs in the OK envelope (partial success: ok:true, plugin_installed:false, exit 0 — matching the Claude path; doctor stays the health gate). The umbrella wizard warns and continues — Codex setup never aborts basecamp setup. Consolidate the codex handler into the agentSetupHandlers literal, drop the unused Confirm field, and record the setup codex surface additions. Claude-Session: https://claude.ai/code/session_01QzoKavmhTPzErRna2KkTKS
Hooks are not shipping in this PR, so remove /hooks-trust instructions and hooks wording from README, install.md, and the AGENTS.md tree, and drop the connect-commits claim from the Codex manifest. Document the basecamp CLI as a prerequisite of both agent plugins, show manual Codex install as plain commands, and point at codex plugin marketplace upgrade 37signals as the refresh step. The basecamp-doctor skill ships to both agents via the shared skills directory, so reword it agent-neutrally and wire it into check-skill-drift. Claude-Session: https://claude.ai/code/session_01QzoKavmhTPzErRna2KkTKS
…e-codex-plugin * origin/main: Bump SDK to d15f023f and collapse todos update onto TodosService.Edit (basecamp#543) Fix agent-help hidden-flag leak; make check-surface a real drift gate (basecamp#542) Fix todos update silently clearing completion subscribers (basecamp#540) Fix TestHardenConfigDir on macOS: resolve TMPDIR symlinks in test dirs (basecamp#536) Bump golang.org/x/net to v0.56.0 for CVE-2026-46600 (basecamp#537)
| var runCodexSetupCommand = func(ctx context.Context, stderr io.Writer, path string, args ...string) ([]byte, error) { | ||
| command := exec.CommandContext(ctx, path, args...) //nolint:gosec // path comes from FindCodexBinary | ||
| var stdout, captured bytes.Buffer | ||
| command.Stdout = &stdout | ||
| if stderr != nil { | ||
| command.Stderr = io.MultiWriter(stderr, &captured) | ||
| } else { | ||
| command.Stderr = &captured | ||
| } | ||
| err := command.Run() | ||
| return append(stdout.Bytes(), captured.Bytes()...), err | ||
| } |
what changed
basecamp setup codex, Codex doctor checks, version parity, release stamping, and repository validationwhy
this gets codex users the same one-command setup without messing with the claude path.
test plan
go test ./internal/harness ./internal/commands -run "Codex|CodexHook" -timeout 60sgo test ./internal/release -run "Codex|Plugin"/hooks, hook fixtures exercised, and Codex doctor checks passedbin/cicompleted plugin, Go, and Actions lint stages; its full macOS run retains the existinginternal/cliTestHardenConfigDirfailures reproduced unchanged onmainSummary by cubic
Ships a native Codex plugin with one-command setup, agent-aware diagnostics, and stable-release stamping. Drops the unproven hook stack; hooks will return in a later PR.
New Features
.codex-plugin/plugin.jsonwith skills and icons.basecamp setup codexregistersbasecamp/claude-plugins, refreshes37signalsif already added, installs the plugin, streams Codex output with per-step timeouts, and returns manual commands in JSON; the wizard never aborts.basecamp doctor --jsonincludes Codex diagnostics..claude-plugin/plugin.jsonand.codex-plugin/plugin.jsonfor stable releases viascripts/stamp-codex-plugin-version.sh; Go tests enforce strict semver and version parity, validate manifest paths, and verifyhooks.jsononly callsbasecampif present.Refactors
bin/ciismake checkagain.AgentInfo.Diagnostics; Claude’s version check moved into diagnostics; doctor now calls agent diagnostics generically.basecampCLI; added manual Codex install and marketplace upgrade guidance.Written for commit 5e614cd. Summary will update on new commits.